//
//  HHYSecondVC.m
//  猫狗交流器
//
//  Created by apple on 2019/2/12.
//  Copyright © 2019 mac. All rights reserved.
//

#import "HHYSecondVC.h"

@interface HHYSecondVC ()

@end

@implementation HHYSecondVC

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.view.backgroundColor = UIColor.whiteColor;

}

- (void)setupNavi_White {
    //导航栏及状态栏
    [self.navigationController.navigationBar setHidden:NO];
//    [UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleDefault;
//    //设置标题属性
//    self.navigationController.navigationBar.titleTextAttributes = @{NSFontAttributeName:hhy_kFont(18), NSForegroundColorAttributeName:[UIColor whiteColor]};
//    //导航栏标题
//    [self.navigationController.navigationBar setBackgroundImage:[UIImage xl_imageWithColor:UIColor.clearColor size:CGSizeMake(hhy_kScreenWidth, hhy_kStatusBarAndNavigationBarHeight)] forBarMetrics:UIBarMetricsDefault];
//    [self.navigationController.navigationBar setShadowImage:[UIImage xl_imageWithColor:UIColor.clearColor size:CGSizeMake(hhy_kScreenWidth, 1.0f)]];
    //设置按钮
    self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:self.backBtn];
    //设置返回按钮图片
    [self.backBtn setImage:[[UIImage imageNamed:@"bt_fanhui"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] forState:UIControlStateNormal];
}

- (void)setupNavi_Black {
//    //导航栏及状态栏
//    [self.navigationController.navigationBar setHidden:NO];
//    [UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleLightContent;
//    //设置标题属性
//    self.navigationController.navigationBar.titleTextAttributes = @{NSFontAttributeName:hhy_kFont(18), NSForegroundColorAttributeName:UIColor.whiteColor};
//    //导航栏标题
//    [self.navigationController.navigationBar setBackgroundImage:[UIImage xl_imageWithColor:kMainNaviBGColor size:CGSizeMake(hhy_kScreenWidth, hhy_kStatusBarAndNavigationBarHeight)] forBarMetrics:UIBarMetricsDefault];
//    [self.navigationController.navigationBar setShadowImage:[UIImage xl_imageWithColor:kMainNaviBGColor size:CGSizeMake(hhy_kScreenWidth, 1.0f)]];
//    //设置按钮
//    self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:self.backBtn];
//    //设置返回按钮图片
//    [self.backBtn setImage:[[UIImage imageNamed:@"bt_f"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] forState:UIControlStateNormal];
}

- (void)hidekeyBoardAction {
    [self.view endEditing:YES];
}

#pragma mark - 返回
- (void)backAction {
    [self.navigationController popViewControllerAnimated:YES];
    //    [self.navigationController popToRootViewControllerAnimated:YES];
}

#pragma mark - HUD
- (void)showHudWithText:(NSString *)text {
    MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:self.view animated:YES];
    // Set the text mode to show only text.
//    [hud hideAnimated:YES afterDelay:10];
    hud.mode = MBProgressHUDModeIndeterminate;
    
    hud.label.text = text;
    self.hud = hud;
}

- (void)hideHud {
    if (!self.hud.isHidden) {
        [self.hud hideAnimated:YES];
    }
}

#pragma mark - getter
- (UIButton *)backBtn {
    if (!_backBtn) {
        _backBtn = [UIButton buttonWithType:UIButtonTypeSystem];
        _backBtn.frame = CGRectMake(8, 23, 40, 40);
        _backBtn.tintColor = [UIColor blackColor];
        [_backBtn addTarget:self action:@selector(backAction) forControlEvents:UIControlEventTouchUpInside];
    }
    return _backBtn;
}

//- (UIImage *)naviImg {
//    if (!_naviImg) {
//        _naviImg = [UIImage xl_imageWithColor:UIColor.whiteColor size:CGSizeMake(hhy_kScreenWidth, hhy_kStatusBarAndNavigationBarHeight)];
//    }
//    return _naviImg;
//}
//
//- (UIImage *)shadowImg {
//    if (!_shadowImg) {
//        _shadowImg = [UIImage xl_imageWithColor:UIColor.whiteColor size:CGSizeMake(hhy_kScreenWidth, CGFloatFromPixel(1.0f))];
//    }
//    return _shadowImg;
//}


/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
